package com.shanghaionstar.remote.manager;

import com.google.gson.JsonObject;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;

/**
 * Created by onstarios on 2017/7/17.
 */


//{
//        "commandResponse": {
//        "requestTime": "2017-07-17T01:58:36.365Z",
//        "url": "https://api-idt1.shanghaionstar.com:1443/api/v1/account/vehicles/LSGAR5AL2G096031D/requests/1464377",
//        "status": "inProgress",
//        "type": "diagnostics"
//        }
//        }
//        {
//        "commandResponse": {
//        "requestTime": "2017-06-26T09:39:11.072Z",
//        "completionTime": "2017-06-26T09:40:33.291Z",
//        "url": "https://api.shanghaionstar.com/api/v1/account/vehicles/LSGZG5378GS026406/requests/293704971",
//        "status": "failure",
//        "type": "diagnostics",
//        "body": {
//        "error": {
//        "code": "ONS-216",
//        "description": "Unable to establish packet session to the vehicle"
//        }
//        }
//        }
//        }

public class PollingResponse {

    private CommandResponse commandResponse;
    private ErrorResponse error;

    public CommandResponse getCommandResponse() {
        return commandResponse;
    }

    public void setCommandResponse(CommandResponse commandResponse) {
        this.commandResponse = commandResponse;
    }

    public ErrorResponse getError() {
        return error;
    }

    public void setError(ErrorResponse error) {
        this.error = error;
    }


    public static class CommandResponse {
        private String completionTime;
        private String url;
        private String status;
        private String type;
        private String requestTime;
        private JsonObject body;

        public JsonObject getBody() {
            return body;
        }

        public void setBody(JsonObject body) {
            this.body = body;
        }

        public String getRequestTime() {
            return requestTime;
        }

        public void setRequestTime(String requestTime) {
            this.requestTime = requestTime;
        }


        public String getCompletionTime() {
            return completionTime;
        }

        public void setCompletionTime(String completionTime) {
            this.completionTime = completionTime;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public String getStatus() {
            return status;
        }

        public void setStatus(String status) {
            this.status = status;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

//        public CommandBody getBody() {
//            return body;
//        }
//
//        public void setBody(CommandBody body) {
//            this.body = body;
//        }


    }

    public static class CommandBody {

//        "ssid"));
//                wifiInfoModel.setPassphrase(body.getString("passphrase"));
        public ErrorResponse error;
        public Location location;
    }

    public static class Location {
        public String lat;
        @SerializedName("long")
        public String lon;
    }

    public static class ErrorResponse implements Serializable{
        private String code;
        private String description;

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }


    }


}
